#define _CRT_SECURE_NO_WARNINGS 1
#include "SList.h"


void test1()
{
	SLNode* Plist = NULL;
	SlistPushBack(&Plist, 1);
	SlistPushBack(&Plist, 2);
	SlistPushBack(&Plist, 3);
	SlistPushBack(&Plist, 4);
	SlistPushBack(&Plist, 5);

	SlistPrint(Plist);

	SlistPopBack(&Plist);
	SlistPopBack(&Plist);

	SlistPrint(Plist);

}
void test2()
{
	SLNode* Plist = CreadList(5);
	

	SlistPrint(Plist);

	SlistPopBack(&Plist);
	SlistPopBack(&Plist);

	SlistPrint(Plist);

}


void test3()
{
	SLNode* Plist = NULL;
	SlistPushBack(&Plist, 1);
	SlistPushBack(&Plist, 2);
	SlistPushBack(&Plist, 3);
	SlistPushBack(&Plist, 4);
	SlistPushBack(&Plist, 5);

	/*SlistPrint(Plist);

	SlistPopBack(&Plist);
	SlistPopBack(&Plist);

	SlistPrint(Plist);*/


	SListPushfront(&Plist, 100);
	SListPushfront(&Plist, 200);
	SListPushfront(&Plist, 300);

	SlistPrint(Plist);
	SListPopfront(&Plist);
	SlistPrint(Plist);

}

void test4()
{
	SLNode* Plist = NULL;
	SlistPushBack(&Plist, 1);
	SlistPushBack(&Plist, 2);
	SlistPushBack(&Plist, 3);
	SlistPushBack(&Plist, 4);
	SlistPushBack(&Plist, 5);

	SlistPrint(Plist);

	//SListPushfront(&Plist, 100);

	SLNode* TP = SLFind(Plist, 1);

	SLInsertAfter(&TP, 100);
	SLInsertFrom(&Plist, TP, 200);


	SlistPrint(Plist);

}void test5()
{
	SLNode* Plist = NULL;
	SlistPushBack(&Plist, 1);
	SlistPushBack(&Plist, 2);
	SlistPushBack(&Plist, 3);
	SlistPushBack(&Plist, 4);
	SlistPushBack(&Plist, 5);

	SlistPrint(Plist);
	SLNode* TP =  SLFind(Plist, 2);
	SLEraseAfter(TP);
	SlistPrint(Plist);

	SListDestroy(&Plist);

}

int main()
{
	//test1();
	//test2();
	//test3();
	//test4();
	test5();


	return 0;
}
	